<template>
	<view class="info">
		<view class="uni-padding-wrap">
			<form :data="form">
				<view class="uni-form-item uni-column uni-inline-item">
					<label class="title">账号</label>
					<input style="text-align: right;" class="uni-input" v-model.trim="form.email" placeholder="请输入账号" />
				</view>
				<view class="uni-form-item uni-column uni-inline-item">
					<label class="title">密码</label>
					<input style="text-align: right;" class="uni-input" type="password" v-model.trim="form.password" placeholder="请输入密码" />
				</view>
				<view class="uni-btn-v"><button class="submit" type="primary" @click="submit">注册</button></view>
			</form>
		</view>
	</view>
</template>
<script>
import { mapGetters, mapActions } from 'vuex';
import { get, post, showToast, copy } from '@/static/utils/index';
import { uploadFile } from '@/static/utils/index';
export default {
	data() {
		return {
			form: {
				email: '',
				password: '',
			},
		};
	},
	computed: {
	},
	created() {
	},
	methods: {
		//注册
		submit() {
			let formData = this.form;
			if (!formData.email) {
				showToast('请填写账号');
				return;
			}
			if (!formData.password) {
				showToast('请填写密码');
				return;
			}
			this.$store.dispatch('register', Object.assign({}, formData)).then(res => {
				if (res.code == 200) {
					showToast('注册成功');
					uni.switchTab({
						url: `/pages/info/index`
					});
				}
			});
		}
	}
};
</script>

<style>
.info {
	min-height: 100vh;
	background-color: #ffffff;
}
.label {
	padding-top: 20upx;
	margin-bottom: 20upx;
	font-size: 32upx;
	color: #9c9c9c;
}
.flex-item {
	margin: 10upx;
	width: 50%;
	text-align: center;
	border-radius: 20upx 20upx 0 0;
	overflow: hidden;
	padding-bottom: 20upx;
	cursor: pointer;
}
.idcard_p img,
.idcard_n img,
.bank_thumb img {
	width: 100%;
	height: 100px;
	height: unset;
}
font {
	color: #0066cc;
}
.idcard_p button,
.idcard_n button,
.bank_thumb button {
	background: #5881ff;
	color: #ffffff;
	border-radius: 0 0 20upx 20upx;
	margin-top: -16upx;
	font-size: 32upx;
}
.submit {
	background-color: #5881ff;
}

.flex-item-V {
	width: 100%;
	text-align: center;
	height: 100upx;
}
.blank {
	height: 20upx;
	background-color: #f4f7fe;
}
.uni-form-item {
	border-bottom: 1px solid #ececec;
}
label {
	display: inline;
	vertical-align: middle;
	width: 80upx;
}
.article {
	background-color: #ffffff;
	max-height: 50vh;
	overflow-y: scroll;
	padding: 20upx;
}
</style>
